execute as @n[tag=StreamBarrierSpawner.hitbox,distance=..1,type=interaction,scores={invulnerable_timer=0..}] run return run data remove entity @s attack
$execute as @p[nbt={UUID:$(player)}] unless items entity @s weapon.mainhand *[custom_data~{id:"stream_barrier_breaker"}] run return run function vs:system/game_ctrol/stream_barrier_spawner/hit_box/weapon_error {player:$(player)}
execute as @s[scores={Power=1..}] unless score @s short_circuit_timer matches -2147483648..2147483647 run return run function vs:system/game_ctrol/stream_barrier_spawner/hit_box/block

particle crit ~ ~ ~ 0.45 0.45 0.45 0.2 8
particle damage_indicator ~ ~ ~ 0.45 0.45 0.45 0.2 1
playsound entity.player.attack.strong player @a ~ ~ ~ 1.0 1.0
playsound block.glass.break player @a ~ ~ ~ 9.0 1.0

scoreboard players set @n[tag=StreamBarrierSpawner.hitbox,distance=..1,type=interaction] invulnerable_timer 10
function vs:system/game_ctrol/stream_barrier_spawner/health/remove {value:1}

data remove entity @n[tag=StreamBarrierSpawner.hitbox,distance=..1,type=interaction] attack